<template>
  <div style="width: 1200px;margin:0 auto;">
    <div class="item-wrapper" v-for="(value,index) in list"  @click="showCollSpc(value)" >
      <div class="item">
        <div class="cover">
          <div class="media-wrapper">
            <div class="show-img"><el-image style="height: 265.99px; width:277.5px ;" :src="`http://localhost:8080/${value.uimg}`"/></div>
          </div>  
        </div>
        
        <div class="item-info">
          <div class="item-name">{{value.cname}}
            <span data-v-33efa880="" class="flag"></span>
          </div>
          <div class="item-id">共:<span>{{value.num}}</span>个</div>

          <div class="item-num">发行份数：<span>{{value.releasenum}}</span></div>
        </div>

      </div>
    </div>
  </div>
</template>

<script>
// import { Session } from 'inspector';

export default {
  name: 'UserCollection',

  data() {
    return {
      list:[],
      username:{username:''}
    };
  },

  mounted() {
    this.getToken();
    this.$http.post("user/showcoll",this.username)
      .then((response)=>{
        this.list=response.data;
    }) 

  },

  methods: {
    showcoll(){
      
    },

    getToken(){

      this.username.username = sessionStorage.getItem('token');
    },
    setToken(value){
      window.sessionStorage.setItem("key", value);
    },
    //具体藏品信息展示跳转方法
    showCollSpc(obj){

      // this.$router.push({name:'/shop/showcoll',params:{cname:obj.cname}});  
      this.$router.push(`/shop/showcoll/${obj.cname}`);  

    }
  },
};
</script>

<style lang="css" scoped>
.item-wrapper{
    width: 25%;
    display: inline-block;
}

.item{
    margin: 15px;
    -webkit-box-shadow: 0 6px 14px rgb(1 0 95 / 10%);
    -moz-box-shadow: 0 6px 14px rgba(1,0,95,.1);
    box-shadow: 0 6px 14px rgb(1 0 95 / 10%);
    background: #f8fbff;
    position: relative;
    /* height: 380px; */
    width: 277.5px;
    /* background-color: darkgrey; */
}

.cover{
  width: 277.5px;
  height: 266px;
  background-color: aqua;
}
.item-name{
  margin-top: 20px;
  margin-left: 10px;
  font-size: 20px;
  line-height: 24px;
  height: 24px;
  overflow: hidden;
}
.item-id{
  color: rgb(255, 153, 0);
  font-size: 18px;
  margin-top: 20px;
  margin-left: 10px;
}

.item-num{
  position: absolute;
  color: #87888e;
  font-size: 14px;
  margin-top: -63px;
  margin-left: 150px;
}


</style>